/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;


import java.util.ResourceBundle;

/**
 *
 * @author Sergey_Stefoglo
 */
public class ConfigurationManager {
                private static ConfigurationManager instance;
                private ResourceBundle resourceBundle;
//класс извлекает информацию из файла config.properties
                private static final String BUNDLE_NAME = "config";

                public static ConfigurationManager getInstance() {
                                if (instance == null) {
                                                instance = new ConfigurationManager();
                                instance.resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
                                }
                                return instance;
                }
                public static ConfigurationManager getInstance(int size){
                  for(int i=0; i<size; i++){
                    if(instance==null){
                        instance =new ConfigurationManager();
                        instance.resourceBundle= ResourceBundle.getBundle(BUNDLE_NAME);
                    
                  }
                    return instance;
                  }
                  return instance;
                }
                                public String getProperty(ConfigEnum key) {
                                return instance.resourceBundle.getString(key.name());
                }

  
}
